<?php

namespace Xenon\Controller;

abstract class AbstractController
{

    public function __construct()
    {
        $this->init();
    }

    public abstract function init();

    public function execute($params = array())
    {
        $this->initRequest();
        $this->initLayout();
        $this->initTemplate();
        $this->initView();
        $this->action();
    }

    public abstract function initRequest();

    public abstract function initLayout();

    public abstract function initTemplate();

    public abstract function initView();

    public function action()
    {

    }

    public function getOutput()
    {
        ob_start();
        $this->output();
        return ob_get_clean();
    }

    public function output()
    {

    }

}
